package com.codefish.codefishseckill.utils;

/**
 * 序列号生成工具类，生成各种业务编号
 *
 * @author codefish
 * @version 1.0
 * @date 2022/07/09 下午 12:19
 */

public class SerialNumberUtils {

    public static Long newOrderNumber(Long userId) {
        StringBuilder sb = new StringBuilder();
        //获取用户id后6位
        Long lastUserId = userId % 10000000;
        //获取时间戳
        Long sysTime = System.currentTimeMillis();
        sb.append(sysTime / 1000).append(lastUserId);
        return Long.parseLong(sb.toString());

    }

}
